import {http} from './request.js'
export const applicationAPI ={
    submitApplication:(data)=>http.secure.post('/business-applications',data),
    updateApplication:(id,data)=>http.secure.put(`/business-applications/${id}`,data),
    getAllApplications:()=>http.secure.get('/business-applications/admin'),
    getApplicationsByStatus:(status)=>http.secure.get(`/business-applications/admin/status/${status}`),
    getMyApplications:()=>http.secure.get('/business-applications/my-applications'),
    getApplicationById:(applicationId)=>http.secure.get(`/business-applications/${applicationId}`),
    reviewApplication:(id, status, reviewComment) => {
        let url = `/business-applications/${id}/review?status=${status}`
        if (reviewComment) {
            url += `&reviewComment=${encodeURIComponent(reviewComment)}`
        }
        return http.secure.put(url)
    },
}